﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.Type
{
    public static class TreeViewNodeExt
    {
        public static List<TreeViewNode> GetAllNodes(this TreeViewNode _self)
        {
            List<TreeViewNode> result = new List<TreeViewNode>();
            result.Add(_self);
            foreach (TreeViewNode child in _self.Nodes)
            {
                result.AddRange(child.GetAllNodes());
            }
            return result;
        }
    }
}
